<div class="container-flusubject_id">
    <?php
//get item param from model
    $Subject = $viewModel->get('subject');
    $courses = $viewModel->get('courses');

    if (!is_object($Subject)) {
        echo 'Subject is not exist!';
    } else {
        ?>
        <h1>Subject Update form</h1>
        <form class="form-horizontal" method="POST">
            <div class="control-group" style="display: none;">
                <label class="control-label" for="inputsubject_name">Subject ID</label>
                <div class="controls">
                    <input type="text" id="inputsubject_id" name="subject_id" value="<?php echo $Subject->subject_id; ?>">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputsubject_name">Subject Name</label>
                <div class="controls">
                    <input type="text" id="inputsubject_name" name="subject_name" value="<?php echo $Subject->subject_name; ?>" placeholder="subject_name" required="required">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputCourseID">Course</label>
                <div class="controls">
                    <select id="inputCourseID" name="courses_id">
                        <?php
                        foreach ($courses as $course) {
                            if ($course->courses_id == $Subject->courses_id) {
                                $choice = "selected = 'selected'";
                            } else {
                                $choice = "";
                            }
                            echo "<option value='" . $course->courses_id . "'" . $choice . ">" . $course->courses_name . "</option>";
                        }
                        ?>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputUsername">Status</label>
                <div class="controls">
                    <select name="status">
                        <option value="0" <?php echo ($Subject->status == 0) ? "selected = 'selected'" : "" ?>>Deactive</option>
                        <option value="1" <?php echo ($Subject->status == 1) ? "selected = 'selected'" : "" ?>>Active</option>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputKeywords">Keywords</label>
                <div class="controls">
                    <input type="text" id="inputKeywords" name="keyword"  value="<?php echo $Subject->keyword ?>" placeholder="Keywords">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="inputDescription">Description</label>
                <div class="controls">
                    <textarea id="inputDescription" class="editor_noimage" name="description" placeholder="Description"  required="required" style="margin: 0px; height: 167px; width: 457px;"><?php echo $Subject->description; ?></textarea>
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <button type="submit" class="btn btn-success">Submit</button>
                    <button type="reset" class="btn">Reset</button>
                </div>
            </div>
        </form>
    <?php } ?>
</div>